package qf.sail.util;

import java.util.Random;
import java.util.UUID;

/**
 * 生成随机码工具类
 */
public class StringUtil {

    public static String generateCode(){
        Random random = new Random();
        StringBuffer code = new StringBuffer();
        for(int i = 0; i < 6; i++){
            code.append(random.nextInt(10));
        }
        return code.toString();
    }

    public static String generateSn(){
        return UUID.randomUUID().toString().toUpperCase().replace("-", "");
    }
}
